package com.heyun.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.heyun.bean.HeyunNotice;
import com.heyun.dao.NoticeMapper;
import com.heyun.service.NoticeService;

@Service
public class NoticeServiceImpl implements NoticeService {
	
	@Autowired
	private NoticeMapper noticeMapper;

	@Override
	public List<HeyunNotice> listNotice() {
		List<HeyunNotice> listNotice = noticeMapper.listNotice();
		return listNotice;
	}

	@Override
	public List<HeyunNotice> getNoticeByLikeNoticeName(String noticeName) {
		List<HeyunNotice> notice = noticeMapper.getNoticeByLikeNoticeName(noticeName);
		return notice;
	}

	@Override
	public int insertNotice(HeyunNotice notice) {
		int s = noticeMapper.insertNotice(notice);
		return s;
	}

	@Override
	public int deleteNoticeByNoticeId(int noticeId) {
		int s = noticeMapper.deleteNoticeByNoticeId(noticeId);
		return s;
	}

	@Override
	public int updateNoticeByNoticeId(HeyunNotice notice) {
		int s = noticeMapper.updateNoticeByNoticeId(notice);
		return s;
	}

	@Override
	public HeyunNotice getNoticeById(Integer id) {
		return noticeMapper.getNoticeById(id);
	}


}
